package com.example.viewdemo.View

import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.example.viewdemo.databinding.ActivityTestViewBinding

class TestViewActivity : AppCompatActivity(), View.OnClickListener {
    private lateinit var binding:ActivityTestViewBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        binding=ActivityTestViewBinding.inflate(layoutInflater)

        binding.textView7.text="中文修改"

        binding.button2.setOnClickListener(this)
        binding.button3.setOnClickListener(this)
        setContentView(binding.root)


    }

    override fun onClick(v: View?) {
        when(v){
            binding.button2-> Toast.makeText(this,"button2", Toast.LENGTH_SHORT).show()
            binding.button3-> Toast.makeText(this,"button3", Toast.LENGTH_SHORT).show()

        }

    }
}